<%@ Page Culture="auto" UICulture="auto" Title="My first MForm control" Language="C#"
    MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="MyFirstMFormPage.aspx.cs"
    Inherits="BM.Tools.WebControls.MForm.Example.Start.MyFirstMFormPage" %>

<%@ Register Assembly="BM.Tools.WebControls.MForm" Namespace="BM.Tools.WebControls.MForm.Controls"
    TagPrefix="mf" %>
<%@ Register Assembly="BM.Tools.WebControls.MForm" Namespace="BM.Tools.WebControls.MForm.Controls.ValueHandlers"
    TagPrefix="mfvh" %>
<%@ Register Assembly="BM.Tools.WebControls.MForm" Namespace="BM.Tools.WebControls.MForm.Controls.Additions"
    TagPrefix="mfadd" %>
<%@ Register TagPrefix="mftitle" Namespace="BM.Tools.WebControls.MForm.Controls.Titles"
    Assembly="BM.Tools.WebControls.MForm" %>
<asp:Content ContentPlaceHolderID="Demonstration" runat="server">    
    <p>
        Here you will see the result of your work when you enerate the form.
    </p>
    <mf:RootValidator runat="server" ControlToValidate="MyFirstMForm" />
    <mf:Root runat="server" ID="MyFirstMForm" />
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="Description" runat="server">
    <p>
        First of all, you need to download this project. It serves both as an example and
        as a tutorial at once. You can download it from
        <asp:HyperLink runat="server" NavigateUrl="http://mform.codeplex.com" Text="http://mform.codeplex.com" />.
        Unzip the project and open it with Visual Studio. Open the current page (<span class="Important">~/Start/MyFirstMForm.aspx</span>).
        You will notice that the page contains an empty control of type <span class="Important">
            mf:Root</span> with id <span class="Important">MyFirstMForm</span>. You can
        switch the editor to design mode.
    </p>
    <p>
        <asp:Image runat="server" ImageUrl="~/Resources/Example/MyFirst/Images/1.jpg" />
    </p>
    <p>
        Currently the MForm control does not look very impressive. It is just a white box
        with some text inside. Click this box and then click a little grey box that should
        appear on the right. <span class="Important">Root Tasks</span> form should appear
        with a possibility to change the designer mode. Change the designer mode to <span
            class="Important">edit</span> mode and then press the <span class="Important">load a
                root template from data definition</span> link.
    </p>
    <p>
        A generator form will appear. In order to generate the form, you have to choose
        the data contract source:
    </p>
    <ul>
        <li><span class="Important">disk</span> - click "choose", a file open dialog will appear,
            select the contract resource type:
            <ul>
                <li><span class="Important">xml schema</span> - xml schema global elements can be generated;</li>
                <li><span class="Important">wsdl file</span> - wsdl global elements can be generated;</li>
                <li><span class="Important">dll managed library</span> - xml serializable object types
                    can be generated;</li>
            </ul>
            then choose a file of the given type and press "Open". </li>
        <li><span class="Important">url</span> - you have to specify a valid url of a .wsdl
            or .xsd resource in the contract location and then click "choose" </li>
    </ul>
    <p>
        If you want to generate a sample MForm from Xml schema, you will find some sample
        schemas in the example project "Schemas" folder.
    </p>
    <p>
        If you want to generate something from Wsdl definitions, you can use Bing's public
        wsdl: <span class="Important">http://soap.search.msn.com/webservices.asmx?wsdl</span>
    </p>
    <p>
        For the purpose of this example we will however generate a form from a library.
        Go to the "bin" folder of example project and choose <span class="Important">BM.Tools.WebControls.MForm.Example.dll</span>
        file (that's right, we will be generating a form from object definitions that are
        in the example project).
    </p>
    <p>
        <asp:Image runat="server" ImageUrl="~/Resources/Example/MyFirst/Images/2.jpg" />
    </p>
    <p>
        After selecting the contract location, we have to choose which element from the
        contract should be generated. The element can be found by name in a list box. In
        our example we will choose the <span class="Important">ToolBoxData</span> element.
    </p>
    <p>
        When the element is chosen, the element's contract tree will be displayed. It is
        possible to generate only a part of the element definition. In order to do it, uncheck
        the children that you do not want to generate. Notice that if you unchcheck an element
        with children, also the children of this element will not be generated.
    </p>
    <p>
        Finally press the "Generate" button. You should see the generated form.
    </p>
    <p>
        <asp:Image runat="server" ImageUrl="~/Resources/Example/MyFirst/Images/3.jpg" />
    </p>
</asp:Content>
